<script setup>
import {saveApi} from "@/api/RoleApi";
import MyForm from "@/components/MyForm.vue";
import {onMounted, shallowReactive, shallowRef} from "vue";
import {RULE} from "@/const";
import MyNav from "@/components/MyNav.vue";
import router from "@/router";
import {listApi} from "@/api/RoomApi";
import {getResponseData} from "@/util";

let arr = [];

// 表单项
let items = shallowRef([
  {'label': '角色名称', 'prop': 'title'},
  {'label': '角色描述', 'prop': 'info', 'type': 'textarea'},
]);
// 表单默认值
let data = shallowReactive({});
// 表单规则
let rules = {
  'info': RULE.COMMON_INFO,
  'title': RULE.COMM_TITLE,
};

/* ==================== 加载函数 ==================== */
onMounted(() => {
})


</script>

<template>

  <my-nav :items="[
  {'icon': 'User', 'label': '员工管理'},
  {'icon': 'User', 'label': '角色列表', 'url': '/ums/Role'},
  {'icon': 'User', 'label': '添加角色'},
]"/>

  <el-divider/>
  <my-form type="insert"
           :items="items"
           :data="data"
           :rules="rules"
           :api="saveApi"
           :fn="() => router.push('/ums/Role')"
           :span="2"/>

</template>

<style scoped lang="scss">

</style>